home *** CD-ROM | disk | FTP | other *** search
-
- ____PPPD (Push/Pop Path & Directory) Ver. 3.01
-
- Purpose: Batch file utility. Allows current drive:\directory and path to
- be pushed (saved) into and later popped (restored) from a file.
- It keeps its data in a file.
-
- Format: PPPD PUSH
- or
- PPPD POP [M]
-
- M pops to the master environment as well as the current one.
-
- Remarks: PPPD PUSH causes the current drive, directory and path to be
- placed in a file. Repeated PPPD PUSHes keep stacking the then-
- current drive, &c. in the file.
-
- PPPD POP switches to the most recently PUSHed drive:\directory &
- path and removes it from the file. When it's popped all the data,
- it deletes the file.
-
- By default, the path is popped into the current active environ-
- ment, the one from which PPPD is called. This is what you normal-
- ly require. If you run with an extra layer of COMMAND.COM or any
- other shell (like DESQview), and especially if you do a lot of
- switching shells (stepping through the DOS door in a program, for
- instance), you might want to use the M option. That makes PPPD
- pop the path into the master environment (the environment belong-
- ing to the lowest layer of DOS) also.
-
- If you don't know what I'm talking about, don't worry. Use PPPD
- POP. If it seems that PPPD isn't restoring the path properly, try
- PPPD POP M.
-
- To use PPPD in a batch file, first, put a line, PPPD PUSH. Then
- put your lines setting up and switching to an application, even
- changing the path string; when the application is finished, PPPD
- POP puts the computer back the way it was.
-
- If something goes wrong (usually an attempt to pop from an empty
- stack file, but possibly insufficient room in the environment for
- the PATH string), PPPD exits, setting the DOS errorlevel as fol-
- lows:
-
- 0 No error. Everything went well.
-
- 1 Complete failure. No data file to pop, couldn't open
- data file to push etc. Path not popped.
-
- 2 (M option only) Popped path into the active environment
- but couldn't pop it to the master environment.
-
- 3 (M option only) Popped path into the master environment
- but couldn't pop it to the active environment.
-
- 255 Syntax error: (no PUSH or POP, Option other than M, &c.)
-
- For most purposes, it's probably wise to make sure PPPD starts
- with a fresh stack file at boot-up. Put a line in AUTOEXEC.BAT to
- DEL C:\STACK3.PPD (or whatever you're using for PPPD's stack). On
- the other hand, if you make a point to PPPD PUSH just before you
- ____PPPD (Push/Pop Path & Directory) Page 2
-
- turn off the computer, PPPD POP in AUTOEXEC.BAT will bring the ma-
- chine up just as you left it.
-
-
- Why Change the Path?
-
- Restoring the DOS path string is PPPD's special feature. Why do
- you need it? Many people set a path which runs through all the
- directories that contain executable files and never change it. If
- you use your PC to do just one or two kinds of task and always
- need the whole set of executable files on tap, then you don't need
- to change the path and you don't need PPPD. (An earlier program
- of mine called "PPD" and several other programs with names like
- "PUSHDIR" and "POPDIR" do all you need.)
-
- On the other hand, if you do many different kinds of things on
- ___ your PC, you probably don't need all the executable files avail-
- _____ able for every kind of task. When you're writing letters, you
- really don't need the debugger handy, and you don't need the thes-
- aurus when you're debugging. The main reason for changing the
- path string, is to keep it short. DOS will find a program faster
- if the path it has to hunt through is short. In addition, occa-
- sionally, you may find it convenient to make sure certain files
- ___ are off the path at certain times.
-
- So, it's useful to change the path when you change tasks. Nor-
- mally, you'll do it with a batch file or a CED synonym. PPPD can
- be called from either of these, when you want to make a temporary
- change. It's especially handy when you're setting up a disk for
- other people who may not be swift about putting things back when
- they depart.
-
-
- To Customize PPPD's File:
-
- As supplied, PPPD will build its stack of data in a file called
- STACK3.PPD on the root directory of drive C:. If this is incon-
- venient, you can change the specification with DEBUG or with a
- disk editor like Peter Norton's NU. Search the file for "FLAG:".
- Immediately thereafter, begins the filespec. You should see:
-
- FLAG:C:\STACK3.PPD
-
- Leave the FLAG: and change the rest to what you will. One thing
- is important: after my C:\STACK3.PPD, you'll see a lot of zeros
- (00 - not the character "0", 30). Your filespec must begin with
- the character next after the colon in "FLAG:" and must not exceed
- the field of zeros. There must be at least one zero IMMEDIATELY
- after the end of the file spec you insert, thus:
-
- 1. Do not overwrite all the zeros; leave at least one.
-
- 2. If your file spec is shorter than mine, fill out the
- unused parts of the field with zeros.
- ____PPPD (Push/Pop Path & Directory) Page 3
-
- Notes: The hard part of this program (getting and setting the path) is
- done by Kim Kokkonen's TPENV. He distributes it free, and I here-
- by gratefully acknowledge it.
-
- The routines used in version 2 ff to write to the current active
- environment are modeled on those in Barry Simon's piece in "Lab
- ___________ Notes," PC Magazine, v8n20, pp 309-14.
-
- Versions:
-
- 2.00 (Nov. 1989) changes the way the POP function works. Version
- 1 popped the path from the data file to the master environ-
- ment. It was satisfactory if you run with the ordinary single
- layer of COMMAND.COM but not if you operate with an extra
- shell. Since POP restored the path to the master environment
- only, you wouldn't see it until you EXITed the extra shell.
-
- Version 2's M option does something to correct that. The
- ordinary POP function puts the path into the active environ-
- ment (the one active when PPPD is run). The M option writes
- to the master environment also. PPPD could still be flummox-
- ed, however, by a sufficiently balled up sequence of shells
- and DOS doors.
-
- 3.00 (Jan. 1990) enlarges the size of the maximum path string that
- can be handled to 254 characters. The DOS command line can't
- hold more than 128 characters, but it's possible to make a
- longer strings by playing tricks. Stack file name changed to
- STACK3.PPD to avoid confusion with previous versions. 3.01
- corrects a bug in errorlevel setting.
-
-
- R. N. Wisan --April 1990
- 37 Clinton St., Oneonta, NY 13820